/*
 * @lc app=leetcode.cn id=1128 lang=javascript
 *
 * [1128] 等价多米诺骨牌对的数量
 */

// @lc code=start
/**
 * @param {number[][]} dominoes
 * @return {number}
 */
var numEquivDominoPairs = function (dominoes) {
  let sum = 0;
  for (let i = 0; i < dominoes.length; i++) {
    for (let j = i + 1; j < dominoes.length; j++) {
      const [a, b] = dominoes[i];
      const [c, d] = dominoes[j];
      if (a === c && b === d || a === d && b === c) {
        sum++;
      }
    }
  }
  return sum;
};
// @lc code=end

